<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2022-08-25 21:33:51
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Models;

use App\Traits\SoftDeletesTrait;

class Api extends BaseModel
    {
    use SoftDeletesTrait;
    public $timestamps = true;
    public $table = "basedata_api";
    protected $guarded = [];

    public function subscribe()
        {
        return $this->hasManyThrough(Subscribe::class, SubscribeApi::class, "api_id", "id", "id", "subscribe_id")->whereStatus_id(0);
        }
    public function role()
        {
        return $this->hasMany(RoleApi::class, "api_id");
        }
    }
